// 导入 defineStore 和 ref 方法
import { defineStore } from "pinia";
import { ref } from "vue";
import { dateZhCN, zhCN } from "naive-ui";

// 定义名为 useTokenStore 的 store
export const useThemeStore = defineStore("theme", () => {
  //水平布局变量
  const horizontalTheme = ref({
    siderWidth: 220,
    multiSiderWidth: 280,
    headerHeight: 56,
    mainPadding: 24,
  });

  //垂直布局变量
  const verticalTheme = ref({
    headerHeight: 56,
    mainPadding: 24,
    headerLeft: 240,
    headerRight: 360,
    siderWidth: 220,
  });

  //通用
  const commonVar = ref({
    layout: "horizontal",
    theme: "light",
    siderInverted: false,
    headerInverted: false,
    mixMenuChildren: [],
    breadcrumbHeight: 36,
    locale: zhCN,
    dateLocale: dateZhCN,
    accordion: true,
    breadcrumb: true,
    tag: true,
    separator: ">",
    tagBorder: true,
    watermark: false
  });

  //主题颜色
  const themeConfig = ref({
    primary: "#00CC7EFF",
    info: "#595959FF",
    success: "#52C41AFF",
    warning: "#f0a020",
    error: "#d03050",
    borderRadius: 3,
    fontSize: 14,
  });

  // 返回 token 变量
  return {
    horizontalTheme,
    verticalTheme,
    commonVar,
    themeConfig,
  };
});
